import unittest
import HTMLTestRunnerPlugins
test_dir = './spick'
report_dir = './report'
report_finename = report_dir+'/'+'report20210608.html'  # 名称和路径

# 设置要运行的测试用例
discober = unittest.defaultTestLoader.discover(test_dir)
# 固定写法
with open(report_finename,'wb') as fp:
  runner = HTMLTestRunnerPlugins.HTMLTestRunner(
    title='接口自动化测试报告',
    description='报告说明',
    stream=fp
  )

  runner.run(discober)